Adding an Auto-Increment ID Field to a Table

Description

If you have existing table that needs a field with a unique ID number, you can create add it with an Update Operation:

Select the Tables/Sets tab of the Control Panel.

  1. Right click the table name.

  2. Select Edit Structure... from the right click menu to add the new field. (It should be a character field. Even if all it contains are numerals, it should not be a number field unless you plan to do math with it.) Make sure the field will be long enough to hold all the possible records. Add more character positions in case you later decide to add a prefix. Do not make this an auto-increment field yet.

  3. Save the structure change.

  4. Right the table name and select Create Operation....

  5. Select Update Records and click Update Genie.

  6. Select the Character tab and click Assign Serial Values.

  7. Define the initial value, the number of characters to display, the increment, and optionally, a prefix.

    images/Update_Records_Genie_1.gif
  8. Define how to order the records in the table before writing the new field values.

    images/Update_Records_Genie_2.gif
  9. Specify which records to update (presumably all records).

  10. Run the update operation.

  11. After running the update, click the table name and select Edit Field Rules....

  12. Set the Field Types tab and set the ID field to Auto-Increment.

All future entries will be handled automatically.

Limitations

Desktop Applications Only